import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        int[] sum=new int[6];
        Scanner sc=new Scanner(System.in);
        for (int i=0;i<sum.length;++i){
            sum[i]= sc.nextInt();
        }
        int ret=findPeakElement(sum);
        System.out.println(ret);
    }
    public static int findPeakElement (int[] nums){
        int i=0;
        for(i=1;i<=nums.length-1;++i){
            if(nums[i]>nums[i-1]&&nums[i]>nums[i+1])
            {
                return i;
            }
            if(nums[nums.length-1]>nums[nums.length-2])
            {
                return nums.length-1;
            }
            if(nums[0]>nums[1])
            {
                return 0;
            }
        }
        return -1;
    }
}